/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ceair.flight.refund.location.dt.enums;

/**
 * 退票操作人员类型状态枚举
 *
 * @author youguilin
 */
public enum ApplyUserType {
    PASSENGER("1", "乘机人"),
    AGENT("2", "代理人"),
    OPERATOR("3", "业务员"),
    SYSTEM("4", "系统");

    /**
     * 简码
     */
    private final String code;

    /**
     * 描述
     */
    private final String description;

    private ApplyUserType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    /**
     * @return Returns the code.
     */
    public String getCode() {
        return code;
    }

    /**
     * @return Returns the description.
     */
    public String getDescription() {
        return description;
    }

    /**
     * 通过枚举<code>code</code>获得枚举。
     *
     * @param code 简码
     * @return 枚举
     */
    public static ApplyUserType getByCode(String code) {
        for (ApplyUserType status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}
